﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Jumpton.SFA.Server.BusinessRule.System;
using Jumpton.SFA.Server.Entity;

public partial class EventManagent_LogDetail : System.Web.UI.Page
{
    private string id = "";
    private const string LogID = "id";
    
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Request.QueryString[LogID] != null)
        {
            id= Request.QueryString[LogID];
        }

        if (!IsPostBack)
        {
            FillData();
        }

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Write("<script>window.close();</script>");
    }

    protected void FillData()
    {
        try
        {
            Jumpton.SFA.Server.BusinessRule.System.EventManager eventmanager = new EventManager();
            EventLog log = new EventManager().LoadByCode(id.ToString());
            if (log != null)
            {
                lbl_time.Text = log.LogCreateDate.ToString();
                string name = "";
                try
                {
                    name = new Jumpton.SFA.Server.BusinessRule.MasterData.PersonManager().LoadByUserID(decimal.Parse(log.LogUserName)).Name;
                }
                catch { name = log.LogUserName; }
                lbl_user.Text = name;
                lbl_type.Text = log.eventLogTypes.LogTypeFriendlyName;
                lbl_content.Text = log.Content;
            }
        }
        catch { }

     
    }

}